<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('选择简历')" />
</head>

<body class="gray-bg">
<div class="container-div">
	<div class="row">
		<div class="col-sm-12 search-collapse">
			<form id="formId">
				<input type="hidden" id="userId" name="userId" th:value="${userId}">
				<input type="hidden" id="positionId" name="positionId" th:value="${positionId}">
				<div class="select-list">
					<ul>
						<li>
							<p>职位类别：</p>
							<select name="positionType" th:with="type=${@dict.getType('job_position_type')}">
								<option value="">所有</option>
								<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
							</select>
						</li>
						<li>
							<p>地区：</p>
							<select name="area" th:with="type=${@dict.getType('job_area')}">
								<option value="">所有</option>
								<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
							</select>
						</li>
						<li>
							<p>薪资范围：</p>
							<select name="salary" th:with="type=${@dict.getType('job_salary')}">
								<option value="">所有</option>
								<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
							</select>
						</li>
						<li>
							<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
							<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
						</li>
					</ul>
				</div>
			</form>
		</div>
		<div class="col-sm-12 select-table table-striped">
			<table id="bootstrap-table"></table>
		</div>
	</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">

    var positionTypeDatas = [[${@dict.getType('job_position_type')}]];
    var areaDatas = [[${@dict.getType('job_area')}]];
    var salaryDatas = [[${@dict.getType('job_salary')}]];
    var prefix = ctx + "job/resumeLib";

    $(function() {
        var options = {
            url: prefix + "/resumeList",
            modalName: "简历",
            showSearch: false,
            showRefresh: false,
            showToggle: false,
            showColumns: false,
            clickToSelect: true,
            rememberSelected: true,
            columns: [{
                field: 'state',
                checkbox: true
            },
                {
                    field : 'resumeId',
                    title : '简历id',
                    visible: false
                },

                {
                    field : 'name',
                    title : '求职者姓名'
                },
                {
                    field : 'positionType',
                    title : '职位类别',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(positionTypeDatas, value);
                    }
                },
                {
                    field : 'area',
                    title : '地区',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(areaDatas, value);
                    }
                },
                {
                    field : 'birthday',
                    title : '生日'
                },
                {
                    field : 'salary',
                    title : '薪资范围',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(salaryDatas, value);
                    }
                }]
        };
        $.table.init(options);
    });

		
		/* 添加用户-选择用户-提交 */
		function submitHandler() {
			var rows = $.table.selectFirstColumns();
			if (rows.length != 1) {
       			$.modal.alertWarning("请选择一条记录");
       			return;
       		}
			var data = { "userId": $("#userId").val(), "positionId": $("#positionId").val(), "resumeId": rows.join() };
			$.operate.save(prefix + "/delivery", data);
		}
	</script>
</body>
</html>